package com.example.asus.a1127;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;

public class LoadinganimActivity extends AppCompatActivity {
    private Animation animation;
    Button button;
    ImageView imageView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_loadinganim);

        imageView= (ImageView) findViewById(R.id.rrr);
        button= (Button) findViewById(R.id.ooo);
        animation= AnimationUtils.loadAnimation(this,R.anim.loadinganim);
       animation.setFillAfter(true);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                imageView.startAnimation(animation);
            }
        });

    }
}
